// @ts-ignore
/* eslint-disable */
import { request } from "@umijs/max";

/** 此处后端没有提供注释 POST /api/create */
export async function createApi(
  body: API.Api,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/api/create", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 DELETE /api/delete/${param0} */
export async function deleteApi(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteApiParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/delete/${param0}`, {
    method: "DELETE",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/get/${param0} */
export async function getApiById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getApiByIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/get/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /api/list */
export async function getApiPage(
  body: Record<string, any>,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/api/list", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /api/offline/${param0} */
export async function offlineApi(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.offlineApiParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/offline/${param0}`, {
    method: "PUT",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /api/publish/${param0} */
export async function publishApi(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.publishApiParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/publish/${param0}`, {
    method: "PUT",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /api/update */
export async function updateApi(
  body: API.Api,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/api/update", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /api/version/create */
export async function createApiVersion(
  body: API.ApiVersion,
  options?: { [key: string]: any }
) {
  return request<API.ResultObject>("/api/version/create", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/version/current/${param0} */
export async function getCurrentVersion(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCurrentVersionParams,
  options?: { [key: string]: any }
) {
  const { apiId: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/version/current/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/version/list/${param0} */
export async function getApiVersions(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getApiVersionsParams,
  options?: { [key: string]: any }
) {
  const { apiId: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/version/list/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /api/version/setCurrent/${param0} */
export async function setCurrentVersion(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.setCurrentVersionParams,
  options?: { [key: string]: any }
) {
  const { versionId: param0, ...queryParams } = params;
  return request<API.ResultObject>(`/api/version/setCurrent/${param0}`, {
    method: "PUT",
    params: { ...queryParams },
    ...(options || {}),
  });
}
